3.303 \(\int \frac{\tan (c+d x)}{(a+b \sec (c+d x))^2} \, dx\)

Optimal. Leaf size=54 \[ -\frac{\log (a+b \sec (c+d x))}{a^2 d}-\frac{\log (\cos (c+d x))}{a^2 d}+\frac{1}{a d (a+b \sec (c+d x))} \]

[Out]

-(Log[Cos[c + d*x]]/(a^2*d)) - Log[a + b*Sec[c + d*x]]/(a^2*d) + 1/(a*d*(a + b*Sec[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0428775, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {3885, 44} \[ -\frac{\log (a+b \sec (c+d x))}{a^2 d}-\frac{\log (\cos (c+d x))}{a^2 d}+\frac{1}{a d (a+b \sec (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + b*Sec[c + d*x])^2,x]

[Out]

-(Log[Cos[c + d*x]]/(a^2*d)) - Log[a + b*Sec[c + d*x]]/(a^2*d) + 1/(a*d*(a + b*Sec[c + d*x]))

Rule 3885

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> -Dist[(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[((b^2 - x^2)^((m - 1)/2)*(a + x)^n)/x, x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{\tan (c+d x)}{(a+b \sec (c+d x))^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x (a+x)^2} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{a^2 x}-\frac{1}{a (a+x)^2}-\frac{1}{a^2 (a+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac{\log (\cos (c+d x))}{a^2 d}-\frac{\log (a+b \sec (c+d x))}{a^2 d}+\frac{1}{a d (a+b \sec (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.038492, size = 54, normalized size = 1. \[ -\frac{b \log (a \cos (c+d x)+b)+a \cos (c+d x) \log (a \cos (c+d x)+b)+b}{a^2 d (a \cos (c+d x)+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + b*Sec[c + d*x])^2,x]

[Out]

-((b + b*Log[b + a*Cos[c + d*x]] + a*Cos[c + d*x]*Log[b + a*Cos[c + d*x]])/(a^2*d*(b + a*Cos[c + d*x])))

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 54, normalized size = 1. \begin{align*} -{\frac{\ln \left ( a+b\sec \left ( dx+c \right ) \right ) }{d{a}^{2}}}+{\frac{1}{ad \left ( a+b\sec \left ( dx+c \right ) \right ) }}+{\frac{\ln \left ( \sec \left ( dx+c \right ) \right ) }{d{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+b*sec(d*x+c))^2,x)

[Out]

-ln(a+b*sec(d*x+c))/d/a^2+1/a/d/(a+b*sec(d*x+c))+1/d/a^2*ln(sec(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.96915, size = 55, normalized size = 1.02 \begin{align*} -\frac{\frac{b}{a^{3} \cos \left (d x + c\right ) + a^{2} b} + \frac{\log \left (a \cos \left (d x + c\right ) + b\right )}{a^{2}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

-(b/(a^3*cos(d*x + c) + a^2*b) + log(a*cos(d*x + c) + b)/a^2)/d

________________________________________________________________________________________

Fricas [A]  time = 0.882972, size = 113, normalized size = 2.09 \begin{align*} -\frac{{\left (a \cos \left (d x + c\right ) + b\right )} \log \left (a \cos \left (d x + c\right ) + b\right ) + b}{a^{3} d \cos \left (d x + c\right ) + a^{2} b d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-((a*cos(d*x + c) + b)*log(a*cos(d*x + c) + b) + b)/(a^3*d*cos(d*x + c) + a^2*b*d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.31203, size = 321, normalized size = 5.94 \begin{align*} -\frac{\frac{{\left (a - b\right )} \log \left ({\left | a + b + \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac{b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{3} - a^{2} b} - \frac{a^{2} - 2 \, a b - b^{2} + \frac{a^{2}{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac{2 \, a b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac{b^{2}{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}}{{\left (a^{3} - a^{2} b\right )}{\left (a + b + \frac{a{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac{b{\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}} - \frac{\log \left ({\left | -\frac{\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a^{2}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-((a - b)*log(abs(a + b + a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1)))/
(a^3 - a^2*b) - (a^2 - 2*a*b - b^2 + a^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*a*b*(cos(d*x + c) - 1)/(cos
(d*x + c) + 1) + b^2*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))/((a^3 - a^2*b)*(a + b + a*(cos(d*x + c) - 1)/(cos(
d*x + c) + 1) - b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))) - log(abs(-(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 1
))/a^2)/d